package com.bauer.os.frame.common;

public class Response <T> {
	
	
	public Meta meta;
	
	public T data;
	
	public Response() {
		this.meta = new Meta(true,"OK");
	}

	public Meta getMeta() {
		return meta;
	}

	public void setMeta(Meta meta) {
		this.meta = meta;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public void success(){
		this.meta= new Meta(true,"OK");
	}
	
	public void failure(boolean success,String message){
		this.meta= new Meta(success, message);
	}
	
	class Meta{
		public boolean success;
		
		public String message;

		public Meta() {
		}
		
		public Meta(boolean success, String message) {
			super();
			this.success = success;
			this.message = message;
		}

		public boolean isSuccess() {
			return success;
		}

		public void setSuccess(boolean success) {
			this.success = success;
		}

		public String getMessage() {
			return message;
		}

		public void setMessage(String message) {
			this.message = message;
		}
	}
}
